fftw3.h is not a library file. It is a header file. You need to tell ld where the library file is. It is not in /usr/local/include; that is where headers are. The library is probably in the directory /opt/homebrew/lib, with file name libfftw3.dylib or another name starting with libfftw3.. Use -L/opt/homebrew/lib -lfftw3 or directly /opt/homebrew/lib/libfftw3.dylib.
I do not know why you have a file /usr/local/include/fftw3.h; I do not think Homebrew on Apple Silicon (ARM) macOS puts files there by default. You should avoid using that one unless you know why it is there; stick to the one in /opt/homebrew/include. If you have done something to install FFTW in /usr/local, then maybe there is a libfftw3.dylib in /usr/local/lib. (Perhaps these things in /usr/local are links to corresponding things in /opt/homebrew, which you installed via some Homebrew option or command? Or did you install them some other way? You should figure out what is in your system and be clear about why it is there and whether you want it there.)