Melt butter in a large, heavy pot over medium heat. Whisk in flour and cook for 1 minute. Add milk in a slow, steady stream whisking to keep from lumping.
Cook for 3 to 5 minutes, until mixture is thick and bubbly. Whisk frequently during this time.
Season with 1 teaspoon salt, 1/4 teaspoon pepper, and 1/4 teaspoon nutmeg. Reserve 3/4 cup of cheese and place remaining cheese in pot and stir until melted.
Remove from heat and stir in cooked pasta and ham. Transfer to a lightly greased 9-by-13-inch baking dish. Top with remaining 3/4 cup cheese.
Combine panko crumbs and melted butter in a small bowl and sprinkle on top of mac and cheese.