Make fails on macOS: libboost_filesystem.dylib not loaded

Recently I have tried to build Blender from source on macOS 13.2.1 on a MacBook Air with Apple silicon. Make command failed with the following error message:

dyld[48252]: Library not loaded: @rpath/libboost_filesystem.dylib
  Referenced from: <AF8F6334-8224-3C43-84F8-E64F1183B83B> /Volumes/Samsung T7/dev/blender-git/lib/darwin_arm64/osl/bin/oslc
  Reason: tried: '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/usd/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/materialx/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/opensubdiv/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/openexr/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/imath/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/boost/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/openimageio/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/opencolorio/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/openvdb/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/tbb/lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/openmp/lib /libboost_filesystem.dylib' (no such file), '/Volumes/Samsung T7/dev/blender-git/lib/darwin_arm64/osl/bin/../lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung T7/dev/blender-git/lib/darwin_arm64/osl/bin/../lib/libboost_filesystem.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung T7/dev/blender-git/lib/darwin_arm64/osl/bin/../lib/libboost_filesystem.dylib' (no such file), '/Volumes/Samsung T7/dev/blender-git/lib/darwin_arm64/osl/bin/../lib/libboost_filesystem.dylib' (no such file), '/usr/local/lib/libboost_filesystem.dylib' (no such file), '/usr/lib/libboost_filesystem.dylib' (no such file, not in dyld cache)
Subprocess aborted

I don’t understand why this is happening since the file at /Volumes/Samsung\ T7/dev/blender-git/blender/../lib/darwin_arm64/boost/lib/ does exist and is a macOS shared library.

jakub@Jakubs-MacBook-Air lib % file libboost_filesystem.dylib
libboost_filesystem.dylib: Mach-O 64-bit dynamically linked shared library arm64

I tried to delete the whole blender-git folder and reclone the repository but it didn’t help. Is there something else I could do?

I solved the issue. It was caused by the fact that my dylib paths had spaces in them. I had to rename my volume, delete the lib and build_darwin folders and rerun make update.