Combine ground beef, salt, pepper, garlic powder, and Worcestershire sauce in bowl. Set aside
Preheat oven to 400 degrees.
Cut off top of garlic to show part of cloves. Drizzle with olive oil and wrap both heads of garlic in aluminum foil. Bake for 40 minutes.
Slice onions into thin slices. Melt butter in large pan over medium heat. Reduce heat to medium low and cook onions for 40-45 minutes until they are a gold brown. Stir frequently so they do not burn. Add 1 teaspoon of olive oil at a time if they are browning too quickly.
While onions and garlic are cooking prepare grill for medium heat. Prepare burgers into 4 patties. Grill for 5-6 minutes on each side or until they are cooked through to your liking.
Top each patty with the Gruyere cheese allowing it to melt.
Carefully remove garlic cloves from head of garlic. Once it has cooled squeeze from bottom and the cloves slip out. Using a fork mash the cloves to make a paste (yields about 2 tablespoons) then add this to a small bowl. Add the lemon juice and mayonnaise and stir. Slather some on bottom buns.
Top each patty with 1/4 cup caramelized onions and and thyme leaves.