Installing missing fftw3 package

Dear FreeFEM++ community,
I’ve been using - version 4.11 with PETSc on my Linux Mint 20.2.
When I ran the dfft.edp example in the manual, I got the message was missing, and the

ff-c++ -auto dfft.cpp

command gives

MISSING lib fftw3, Check the WHERE-LIBRARYfiles

How can I install the missing fftw3 package without ruining the existing installation?

A follow up to my previous question:
I installed fftw3 and tried go generate file via

ff-c++ -auto FreeFem-sources/plugin/seq/dfft.cpp

command, but I’m getting

eval FreeFem-sources/plugin/seq/ff-c++ /home/aziz/Documents/SourceCodes/FreeFem-sources/plugin/seq/dfft.cpp -lfftw3
g++ -c -fPIC ‘-I/FreeFem-sources/plugin/seq/include’ -g -DNDEBUG -O3 -mmmx -mavx -std=c++14 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC -I/petsc/arch-FreeFem/include ‘/FreeFem-sources/plugin/seq/dfft.cpp’

g++ -shared -fPIC -g -DNDEBUG -O3 -mmmx -mavx -std=c++14 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC -I/petsc/arch-FreeFem/include ‘dfft.o’ -o ‘-lfftw3’

/usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

I don’t know how to fix that. On the other hand, without the auto command, it works fine, but doesn’t generate the file

ff-c++ FreeFem-sources/plugin/seq/dfft.cpp

Somehow installing/reinstalling fftw3

sudo apt-get install libfftw3-dev libfftw3-doc

and reconfiguring fixed the issue.