Makefile: handle header dependencies

Generate and use gcc's dependency output in the Makefile to
handle dependencies that aren't covered by pattern rules.