Makefile: Fix shared library building on various OSes

Versioned on OS != Windows, and create a .dll.a implib on Windows