There's a multitude of recipes for homemade root beer. Here's one that tends towards simplicity and budget-friendly ingredients:
Put a half-cup of sassafras root bark and a half-teaspoon of wintergreen leaf together in one of your biggest pots along with a dash each of allspice and coriander, plus a stick of cinnamon. Mix all this with 3 quarts of water (preferably filtered, distilled, purifed, etc).
Place the pot on the stove, and turn the heat to high. Let it come up to a boil before reducing the heat to a simmer level. Let it simmer for a quarter of an hour.
Get a fine-meshed strainer so you can strain out the herbs. A cheesecloth also works.
Once strained, and while the liquid is still warm. Add in both a quarter-cup of molasses a full-cup of cane sugar. The sugar should be unrefined and organic; rapadura is a good choice. Stir all this until the sugar and molasses are visibly dissolved.
Let the solution cool a little so it is no longer hot, but while it still has warmth, add in a quarter-cup of lime juice, followed by a starter culture of your choice. Stir again.
Pour this liquid into jars, and fit the lids tightly. Fermentation needs at least two days in room-temperature climate. After the second day, check daily for the carbonation. When you like it, put it in your fridge and store until you drink it.
For a real in-depth look at the full process of making root beer, check out the YouTube video below.