Preheat oven to 400°F. Lightly spray a casserole dish with nonstick cooking spray.
In a medium-size saucepan, melt butter over medium heat. Mix in the flour and salt, and stir constantly with a whisk for one minute. Stir in milk. Cook until mixture has thickened.
Stir in cheese all at once, and continue stirring until melted and smooth, about 30-60 seconds.
Pour ⅓ of the milk mix into the bottom of the baking dish. Layer in ⅓ of the potatoes. Add another ⅓ milk mix, then ⅓ of the potatoes. Add the remaining potatoes, then pour over the last of the remaining milk mix. Try to get the potatoes in an even layer.
Cover and bake 1 hour 45 minutes to 2 hours.
Remove the foil and top with more shredded cheese. Bake for another 20 minutes, until the cheese is golden and melty. Serve the dish warm, topped with fresh thyme, if desired.