ncurses, deadline, lapack path problem in m1 arm64 ventura 13.6

My mac m1 arm64 computer has a linking problem in the configure command.

However I export this in my bash_profile.

export LDFLAGS="-L/opt/homebrew/opt/ncurses/lib" export CPPFLAGS="-I/opt/homebrew/opt/ncurses/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH"

LDFLAGS+=" -L/opt/homebrew/opt/readline/lib" CPPFLAGS+=" -I/opt/homebrew/opt/readline/include" PKG_CONFIG_PATH+=":/opt/homebrew/opt/readline/lib/pkgconfig"

LDFLAGS+=" -L/opt/homebrew/opt/lapack/lib" CPPFLAGS+=" -I/opt/homebrew/opt/lapack/include" PKG_CONFIG_PATH+=":/opt/homebrew/opt/lapack/lib/pkgconfig"

configure:20728: checking for library containing beep configure:20764: /opt/homebrew/bin/gcc-12 -o conftest -g -O2 -Wall -I/opt/homebrew/opt/ncurses/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/lapack/include -L/opt/homebrew/opt/ncurses/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/lapack/lib -W -Wall -L/opt/homebrew/lib/ -L/opt/homebrew/Cellar/readline/8.2.1/lib/ -L/opt/homebrew/Cellar/ncurses/6.4/lib/ -L/opt/local/lib -L/usr/local/lib -I/usr/local/include/ -I/opt/local/include conftest.c >&5 ld: warning: directory not found for option '-L/opt/homebrew/Cellar/readline/8.2.1/lib/' ld: warning: directory not found for option '-L/opt/homebrew/Cellar/ncurses/6.4/lib/' ld: warning: directory not found for option '-L/opt/local/lib' Undefined symbols for architecture arm64: "_beep", referenced from: _main in cc2370AN.o ld: symbol(s) not found for architecture arm64 collect2: error: ld returned 1 exit status