Fixes the DLL type and flags and builds the debug version of the
DLL if required.