Starting from Mac 11 (Big Sur), it appears we need to add -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem for the sharedlib to link properly.i