Ubuntu 18 "recompile with -fPIC"

ROOT Version: v6.26.10
Platform: Ubuntu 18.04
Compiler: cmake version 3.25.1

On Ubuntu 18.04, I first had to install a number of libs (libxpm-dev, libxft-dev, libxml2, libxml2-dev, zlib1g, zlib1g-dev, uuid-dev, libz3-dev, automake) and now the compilation gets to 84%.
I compile using the following 3 commands:

cmake -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR ../root_src -DCMAKE_CXX_STANDARD=17
cmake --build . --target install -j3
make install

However, during “make”, after 84%, it complains:

/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

Where do I put this “-fPIC” flag? I tried putting it after “make” and after “cmake”, but in both cases it complains. How should I “compile with -fPIC” (and will this give a useful root installation)?

Best regards,

Machiel

For some reason, most solutions in the previous links did not work. I also didn’t manage to compile fftw from source (“recipe for target ‘all’ failed”), so I ended up configureing ROOT with the additional flag:
-Dbuiltin_fftw3=ON”, as you suggested.
This worked: root compiled.
My question is: does this have any consequences? Will root fail in certain circumstances because it has been configured this way?

Best regards,

Machiel