Generate and use makefile dependencies