Preheat oven to 350 degrees F. Spray or coat a 2 quart casserole dish.
Peel and slice potatoes. Some people choose not to peel the potatoes, but I prefer them peeled. Cut the ham into small pieces. Put both into the casserole dish and mix around so the ham is spread throughout the potatoes.
In a small sauce pan, melt 3 tbsp butter. Add finely chopped onion to the butter once melted. Cook until tender.
Add in flour, salt and pepper. Stir well until smooth.
Remove from heat. Add in milk and mix well. Place back on the burner and bring to a boil, stirring constantly. Boil for about a minute. The mixture will thicken.
Pour the sauce over the potatoes and ham. Cut the last tablespon of butter into small pieces and spread over the top of the scalloped potatoes and ham.
Cover and bake for 30 minutes. After 30 minutes, remove the lid and bake for an additional hour, until potatoes are tender.
Allow to cool for 5-10 minutes before serving.