fixed the linker rules for macos & linux(?)