Can't you simply include all 3 files? Matlab will select the correct one automatically.
As to your point about deciding in code what you are running on: you can use the ispc() and ismac() functions. You might be able to use the computer() function to check if you're on ARM or x86_64.