[osx] Weak link to system libraries for compatibility