Add automatic build dependency generation

Add automatic generation of build dependencies for build targets. Slim down the
includes to only pull in what is actually used in the different C-files.
Merge pull request #8 from abbeman/master

Add automatic build dependency generation