I have an Arduino Uno and a Linux environment. Though the Arduino IDE is great and all, however it doesn\'t give me much inputs if something goes wrong. And it also becomes excr
You might want to set the Arduino IDE compile options to verbose. Then compile something and watch the IDE's output. It will tell you where it locates the .cpp file and which compiler options it uses. Once you look into the .cpp file you see immediately what you need to include.
After that the makefiles become much easier to understand. If you have no prior experience with make my advice would be to avoid it and go for scons instead. Scons is written Python. Thus you immediately benefit from much simpler debugging.