Preheat oven to 400°F (200°C). Cut the tops off garlic bulbs, drizzle with olive oil, wrap in foil, and roast for 40 minutes until soft.
Mash roasted garlic and mix with butter, rosemary, and thyme. Set aside.
Lower oven temperature to 250°F (120°C). Coat the prime rib with olive oil, salt, and black pepper. Place in a roasting pan with the fat side up.
Roast for about 3 hours or until the internal temperature reaches 120°F (49°C) for medium-rare.
Remove roast from oven and tent with foil. Let it rest for 30 minutes.
Increase oven temperature to 500°F (260°C). Spread garlic butter mixture over the roast.
Return roast to oven for 10 minutes until the crust is golden and crispy.
Let rest for 10 more minutes before slicing. Serve with pan juices.