Heat the butter till melted and add onion, carrot and celery. Cook over medium-low heat for about 15 minutes, stirring often.
Add the beans and the thyme and raise the heat to medium-high. Stir while cooking for about 2-3 minutes and then add the stock. Lower the heat to medium and cook until all the vegetables are very soft. Add more water during the process if the stock evaporates.
Cool for a few minutes and then purée in a blender or processor. Return the soup to the pot and reheat. Season with salt and pepper. Add the cream (if using) and reheat, without boiling, until the soup is very hot.
Serve immediately in warm bowls. If you are using crème fraîche or yogurt as a garnish, omit the regular cream in the previous step. Place a tablespoon of crème fraîche or yogurt in the center of each portion, and if you have it, maybe a bite of cooked ham.