Newer versions of MacOS require linking against *.tbd files and not old system paths to *.dylib

Can you try using cmake --trace-expand to see where that libm.dylib path is coming from?