You can use the method in this recipe - making a white sauce of flour, butter, and milk before adding the pesto - or use heavy cream and cook on low until it thickens slightly (it will be runnier than a white sauce). Another option is to thicken your pesto with potato starch or corn starch and add a milk product until it's as creamy as you wish (this is a good dairy-free alternative).