Hi,
I was able to resolve this problem on macOS Sierra and a non-system Homebrew python installation (python 2.7), using the "install_name_tool" command as mentioned in http://stackoverflow.com/a/32325887.
For this to work first get the list of linked libraries using:
otool -L _ok.so
In this list you will find the curren linked python library, like:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
Search for the correct location of the library. In case of Homebrew I used:
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
(pay attention to the correct version numbers)
then use install_name_tool to change (replace with paths):
install_name_tool -change <current> <new>