mingw/msys fixes
make symbols visible when building a shared library
add support for building both static and shared lib