Water works well with cornstarch as a thickening slurry but if you're using flour, I recommend making a roux with butter, olive oil, or bacon grease (depending on the taste profile you're looking for). Cooking it as a roux will get rid of the uncooked taste of the flour. Alton Brown had a great explanation on "Good Eats" of the food science behind what's happening when making a roux but the shows aren't available on YouTube anymore.

Here's a recipe from Alton for a white roux (just the recipe, no Mr. Wizard-type explanations):

https://altonbrown.com/recipes/white-roux/