Lots of improvements to Makefile stuff.

The biggest ones are:
* fixing the OTP make targets
* adding missing vars
* moving make includes into their own dir