Also generate a .dll in MinGW builds

Previously only static a static library was produced on MinGW builds,
this PR makes sure that we also build a proper .dll
Merge pull request #531 from jin-eld/dll

Also generate a .dll in MinGW builds