CompatMakefile: Depend only on one representative of each target
CompatMakefile: Handle directories