Heat the olive oil in a large pot over medium heat, add the onions and carrots. Cook approximately 5 minutes until the onions are translucent, stirring frequently.
Add the garlic, tomato paste, salt, oregano, cumin, and black pepper. Cook 1 minute, stirring frequently.
Add the ham shanks, chicken broth, water, and bay leaf to the pot, stir well. Raise the heat to high and bring the liquid to a boil. Then, lower the heat to medium-low, cover and cook 10 minutes, stirring occasionally.
Add the lentils to the pot, cover and cook for about 20 minutes until the lentils start to soften, stirring occasionally.
Remove the ham from the pot and let it cool down on a plate or cutting board. In the meantime, add the potatoes and the pumpkin to the lentil stew. Bring the liquid back to a boil, then lower the heat to medium-low, cover and cook for 15-20 minutes, or until the lentils, potatoes, and pumpkin are tender.
When the ham shanks cool down take the meat off and discard the fat and bones. Chop the ham and return it to the pot.
Keep the broth at a simmer. Raise or lower the heat as needed. Stir occasionally.
Remove the bay leaf and discard. Taste and add salt if needed. As a reference we added 1 teaspoon to ours.