Preheat oven or grill to 350 degrees F. Line a baking sheet with parchment paper for easy clean up.
Melt butter in saute pan over medium heat. Cook onions until fragrant and slightly brown while stirring occasionally, about 3-5 minutes. Reduce heat to low and add garlic, cook for 2-3 minutes. Remove from heat and set aside to cool.
In large bowl, combine ground beef, egg, bread crumbs, milk, Worcestershire sauce, thyme, salt and cooked onions and garlic. Use hands to mix well, but try not to over work the meat. Shape into loaf on parchment lined baking sheet. Use sharp knife to cut a criss cross pattern on top.
Bake uncovered in the preheated oven 40 minutes. While meatloaf is cooking, combine ketchup with mustard and brown sugar in a bowl. Set aside.
After 40 minutes of cooking, spread ketchup mixture over the top of the meatloaf and continue baking for about 30-35 minutes to an internal temperature of 160 degrees F (70 degrees C).