makefile improvements (dependencies)

--HG--
extra : rebase_source : 0a0aa5abe44cd0d9f287b462cf47fd8fa74492b4
makefile: exit if something fails in a loop

--HG--
extra : rebase_source : 1979ef9ad8289e052d2e8dbaf4a17fd7003fcea1
Merge pull request #87 from spikykiwi/makefile_improvs

Makefile improvements