I have software that first loads a .dylib lets call libFirst.dylib using the following command:
void* handle = dlopen(path.c_str(), RTLD_LAZY | RTLD_GLOBAL);
use:
install_name_tool -id @executable_path/../Frameworks/mylib.dylib mylib.dylib
then check it with:
otool -D mylib.dylib