Fix compilation with latest LDC.
Use -d-debug instead of -debug for LDC.
Use separate compile/link only for dmd (and not for ldmd and gdmd).