In a skillet, cook ground beef over medium heat until browned. Drain excess fat.
In a saucepan, melt butter over medium heat. Stir in flour, salt, and pepper until smooth. Gradually add milk, stirring constantly until thickened.
In a greased baking dish, layer half of the potatoes, half of the onions, and half of the ground beef. Pour half of the sauce over the layers. Repeat layers with remaining ingredients.
Cover and bake for 1 hour. Uncover, sprinkle with cheese, and bake for an additional 10 minutes or until cheese is melted and bubbly.
Notes:
Let the casserole rest for a few minutes before serving to allow it to set.