Homebrew directories different on Apple Silicon than macOS Intel

My C++ code won't compile on my new Mac (with Apple Silicon) because it can't find gsl libraries. I think this is because Homebrew uses /opt/homebrew for Apple Silicon, and /usr/local for macOS Intel, and my code is looking for gsl in /usr/local. How can I get my code to find gsl on my new Mac?

It's a swift answer, but you may be able to work it out for c++.

https://developer.apple.com/forums/thread/678914

Homebrew directories different on Apple Silicon than macOS Intel
 
 
Q