fix more linkage issues on macosx