Thanks for the tips everyone, I've pulled out clock speed, mcu type and arduino defines and made a few of the other changes as well, will upload it to my page over the weekend. I've been trying to keep the build process the same as how the IDE does it, although now that I think about it I guess that's not necessarily the best option. Three things that are still bugging me:
1) The IDE clearly does some pre-processing during which it includes "Arduino.h" and adds some forward declarations. I've verified this by comparing my source files to the ones in the build folders, there's new code in there. Is there a command-line tool that does this?
2) Some of the libraries have sub folders that also need to be included, i.e. SD,, Ethernet and Wire all have a "utility" sub folder. In my makefile I include them manually, how does the the IDE know about them? Does it simply always check to see if a "utility" sub folder is present in each library? Are there any other sub folders it checks for?
3) Anyone know if there's any way to strip unused code from the elf? According to the docs you should be able to do it by placing libraries in their own lib files and specifying -ffunction-sections, -fdata-sections and --gc-sections. Tried that...didn't work