Add -shared flag for DMD when building dynamic libraries.