Sauté vegetables: Heat the olive oil in a large pot or Dutch oven over medium heat. Add the onion, carrots, and celery and cook for 5-7 minutes, stirring occasionally, until softened.
Add garlic and ginger: Stir in the minced garlic and grated ginger and cook for 1 minute more, until fragrant.
Add lentils and remaining ingredients: Add the rinsed lentils, crushed tomatoes, vegetable broth (or chicken broth), butternut squash or sweet potato, potatoes, thyme, rosemary, cumin, red pepper flakes (if using), salt, and pepper. Stir well to combine.
Simmer: Bring the soup to a boil, then reduce heat to low, cover, and simmer for 45 minutes to 1 hour, or until the lentils and vegetables are tender.
Add greens (optional): If using kale or spinach, stir it into the soup during the last 15 minutes of cooking.
Taste and adjust: Taste the soup and adjust the seasonings as needed.
Serve: Serve hot, garnished with fresh parsley, crusty bread, and a dollop of yogurt or sour cream, if desired.