Place roast, ribs down, in center of a large roasting pan. Rub roast all over with 1/2 tablespoon of olive oil.
Cut about 1/2" from tops of garlic bulbs to expose cloves; discard tops.
Rub beef all over with the cut sides of garlic. Sprinkle all sides of beef with 2 tablespoons of thyme, salt and freshly ground black pepper.
Place garlic bulbs in a double layer of foil and drizzle with remaining 1/2 tablespoon olive oil. Wrap garlic tightly with foil. Set aside.
Place prime rib in oven and roast for 30 minutes.
Remove beef from oven and skim all but about 1/2 cup of fat from bottom of pan. Baste beef with remaining fat.
Reduce oven temperature to 375°F.
Add foil wrapped garlic to oven. Continue roasting beef with garlic for about 1-1/4 to 1-1/2 hours or until a meat thermometer inserted into center of meat registers 115°F.
Transfer garlic wrapped in foil to a rack and beef to a platter, reserving any pan juices. Cover beef loosely with foil and let stand for 25 minutes (roast will continue to cook, reaching about 130°F for medium rare).
While beef is resting, remove all but about 2 tablespoons of fat from roasting pan. Add shallots to pan and place roasting pan on stove top over medium heat. Sauté shallots for about 2 minutes.
Unwrap garlic and carefully squeeze out roasted garlic into shallot mixture (discard garlic skins). Add vinegar, wine, bay leaf, gf beef stock and remaining tablespoon of thyme; bring to a boil, scraping up any browned bits on bottom of pan. Mash garlic, with a spoon, against bottom of pan, until mixture is reduced by 1/2, about 5 minutes.
In a small bowl, whisk gf flour with 1/4 cup water until smooth.
Gradually add flour mixture to sauce, stirring constantly. Bring sauce to a boil and cook, stirring constantly until reduced to about 2 cups. Whisk in butter until sauce is blended.
Pour sauce through a fine sieve, pressing hard on solids. Adjust seasonings to taste with salt and freshly ground black pepper.
Carve prime rib roast into slices and serve with sauce.