Rinse the lentils under running water in a large sieve. Put them in a soup pot with 4 cups water and 4 cups vegetable broth.
Peel and dice the yam and carrots and add them to the lentils.
Bring the broth to a boil, then lower the heat and simmer about 30 minutes.
Meanwhile, heat a tablespoon olive oil in a pan and sauté the onion, with a dash of salt, stirring over medium-high heat for 3-4 minutes.
Lower the heat and cook onion gently for 20 minutes more, stirring occasionally, until it is golden and soft. Push the onion to the sides of the pan, add the remaining oil and the chopped garlic in the center, and stir for a minute or two.
Add the onion and garlic to the soup and simmer everything together for about five minutes.
Add the cumin, coriander, turmeric, cayenne, and salt to soup. Puree the soup with immersion blender, taste it, and add a pinch of salt if needed.
Stir in the lemon juice. If you want a slightly richer soup, stir in the coconut milk – and reserve a few spoonfuls to swirl into the top of the soup when it is served.
Garnish the soup with the coconut milk, or with a drizzle of oil, and with a scattering of chopped pistachio nuts or a few cilantro leaves, or any combination.
Pass harissa at the table for those who like it hot.