fix Issue 11478 - shared library on osx

- fix incomplete support for shared libraries
Merge pull request #679 from dawgfoto/fix11478

[regression] fix Issue 11478 - shared library on osx