Help FOR M1 Users trying to compile repos and getting file not found errors

I am posting this here in case it can help someone. For quite a while now I have been scratching my head as to why I could not get some repos (AULIB, SOUNDPIPE, etc) to build. They kept giving me file not found errors for libraries I knew I had already installed. (i kept getting Sndfile.h not found errors , etc)

Today I finally found a clear cut REASON For my issues and an easy fix.
(you can find the answer in this stack overflow thread)

HOW TO MAKE OLD C REPOS BUILD ON M1 OSX

  1. Make sure to install all dependencies for your repo
  2. RUN MAKE
  3. If you get “file not found” errors which are related to the Changed M1 lib location then run

export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib

for those like myself who are still pretty new to using Make (and like me you have even tried to edit the make file to see the new OPT/ location with no luck) then this is a really amazing fix.

(I guess this brings up the question for me–is there a good book or article or youtube video which goes over editing makefiles? )