configure: Check for -no_weak_imports in ldflags on macOS