Preheat the oven to 375°F and lightly grease a medium baking dish.
Cook the elbow macaroni in a large pot of salted boiling water until al dente. Add the broccoli florets during the last two minutes of cooking. Drain and set aside.
In a saucepan over medium heat, melt the butter. Whisk in the flour and cook for one minute until bubbly. Slowly pour in the milk while whisking to create a smooth sauce.
Stir in the garlic powder along with salt and pepper. Remove from heat and mix in 1 1/2 cups of the shredded cheddar until melted.
Combine the drained pasta and broccoli with the diced ham in a large bowl. Pour the cheese sauce over the mixture and stir until everything is evenly coated.
Transfer the mixture to the prepared baking dish. Sprinkle the remaining 1/2 cup of cheddar cheese evenly over the top.
Bake for 20 to 25 minutes until the cheese is melted and the edges are lightly golden. Let it rest for a few minutes before serving.