Preheat oven to 400°F. Cook the macaroni according to the package instructions.
While the pasta is cooking prepare the cheese sauce: In a large saucepan, over low heat add the butter and when it has melted whisk in the flour and, stirring constantly cook until smooth and bubbly, about 3 minutes.
Whisk in the milk, salt and pepper, thyme and red pepper if using. Bring the mixture to a boil, continue cooking and whisking for another minute or two to a smooth, silky sauce.
Remove the pan from the heat and add the shredded cheese stirring until the cheese is completely melted.
Add the cooked and drained macaroni and toss with the sauce to combine well.
Transfer the mixture to a greased or sprayed 8x8 oven-proof casserole dish, sprinkle with bread crumbs and transfer to the middle rack of the oven.
Bake uncovered for 25-30 minutes or until the bread crumbs are golden brown and the sauce begins to bubble up to the top. Remove from the oven, garnish with the fresh thyme sprigs and serve.
Notes
Cook the pasta slightly underdone. Subtract about 3 minutes from the package directions since it will continue cooking in the oven.Remove the pan from the heat before adding cheese. This prevents the cheese from overheating and separating into an oily mess.Salt the pasta water generously. The pasta absorbs the salt as it cooks so it is seasoned from the inside out. Grate your own cheese. Pre-shredded cheese is coated in anti-caking agents that can make the sauce grainy.