Replace implementation of linkWithLibrary()