dmake: Improved handling of CFGDIR