On my previous computer I had Xcode working nicely; on my present computer, with Homebrew installed, gcc and make are present in /Developer/usr/bin but not /usr/bin. On the whole when I try to download and build http://JonathansCorner.com/download/tms1_4.tar.gz, I can find bits and pieces of the tools used to do things, but when invoked from its present path it doesn't recognize #include <stdio.h> type includes.

How can I reinstall Xcode, Homebrew, and anything else to get a fresh and working build so I can run make && make install?

If any brewed packages still seem broken, brew rm them and brew install --fresh to reinstall.

Edit your shell config file (e.g. ~/.bashrc) to make sure /usr/local/bin is on your path. brew doctor can help diagnose this and other issues.

Note that tms is designed to install to /usr/lib by default, which you won't have permissions to do in a normal OS X setup even once you have all the tools installed, because the OS reserves /usr for its own use. You'll probably want to fiddle with the Makefile and tms.h to get it in to /usr/local or /opt, which are easier places to drop user-built packages.

If you're feeling ambitious, you could even do brew create http://jonathanscorner.com/download/tms1_4.tar.gz to make a Homebrew formula for TMS, making repeated installs easier.