Preheat oven to 400 degrees.
Sprinkle chicken with a little salt and pepper. Arrange on a baking sheet lined with foil. Cover chicken with foil and bake for 45 minutes.
In the meantime, make the barbecue sauce: In a nonstick pan, heat olive oil over medium-high heat. Add onions and garlic and saute for about 2 minutes until onions are soft. Stir in root beer and bring to a boil. Reduce heat to low and simmer until reduced to ½ cup, about 15 minutes. Be sure to keep an eye on it as it can burn easily.
Stir in ketchup, vinegar, brown sugar, mustard, molasses, Worcestershire, and red pepper flakes. Simmer for about 15 minutes until the sauce thickens.
Remove pan from heat and stir in lemon juice.
Remove cooked chicken from oven. Cool slightly. Remove and discard all the skin.
Dip chicken pieces into barbecue sauce to coat. Note: Since the chicken is already cooked there’s no need to worry about cross-contamination. Grill covered for 5 minutes. Turn over and spread with more sauce. Continue to grill until charred, about 5 more minutes.
***To broil instead of grilled: Preheat broiler. Dip chicken pieces into barbecue sauce to coat. Place pieces on a baking sheet lined with foil. Broil for 5 minutes, turn over, coat with more sauce and broil for another 4-5 minutes until browned.