Try to fix static/shared libraries on OSX

I don't currenly have a machine to try this out on, but I'm fairly
certain this will work.  At least it doesn't break anything on my own
machine :).