Preheat oven to 450°F. Place roast, rib-side down, in a large roasting pan, and sprinkle with salt and pepper and 1 teaspoon of the thyme. Roast beef 30 minutes.
Trim the top (pointy ends) of each head of garlic to expose the cloves inside. Place each head on a square of aluminum foil and sprinkle with 1 teaspoon of the thyme, a little salt, and pepper. Fold aluminum squares to seal. Reduce heat to 375°F. Place wrapped garlic directly on the oven rack beside the roast. Continue to cook 1-1/4 to 1-1/2 hours, or until a meat thermometer inserted into the center of meat registers 115°F. Remove beef and garlic from oven. Let beef stand 25 minutes to continue cooking to medium-rare, or 130°F.
Meanwhile, pour off all but 2 tablespoons of the pan drippings. Unwrap the garlic and squeeze the roasted cloves into the pan; discard the skins. Add the shallots, wine, vinegar, bay leaf, and remaining 1 teaspoon thyme, and cook over moderate heat on top of the stove, scraping up the browned bits from the bottom of the pan while mashing the garlic with the back of a spoon. Cook, stirring occasionally, until reduced to about 1/2 cup, about 5 minutes. Discard bay leaf, which is inedible.
Add the beef broth and continue to reduce the sauce until it measures about 2 cups, about 10 minutes. In a small bowl, combine the butter and flour and blend it into the sauce. Boil 1 minute. Season with salt and pepper. Cut rib roast into slices and serve with sauce.