Fix broken inclusion of .d-files for submodule targets

Inclusion of .d-files from the compiler used the wrong path for submodule
targets. The object directory for the target included the submodule directory
so when source files which also contains submodule directory was concatenated
to the result a non-existing path was created, and no .d-files where found.