Some shared fixes

These are some fixes for the shared build (tested with i686-pc-mingw32.static and i686-pc-mingw32.shared, at least no regressions in those configurations)

- The fixes to lcms1 and boost are trivial
- The fixes to pthreads-w32 make this a proper shared library where gnutls actually can link against
- The small fix to gnutls fixes a linking error (I will send that upstream tomorrow)