Fix for SONAME generation

These changes allow using SOVERSION and VERSION target properties to automatically generate .so.X.Y shared libraries.
Also put the defaultlib argument only in case DMD is used, as I'm pretty sure it's not applicable to other compilers.