makefiles: Also use dll flags when building a shared library.