HDF5 version: 1.14.6
Using cmake to build HDF5 produces the following line in libhdf5.settings:
While using autoconf, the line looks normal:
Extra libraries: -lz -ldl -lm
Here is the cmake command I used.
export CC=$HOME/MPICH/4.3.0/bin/mpicc
cmake ../hdf5-1.14.6 -D"HDF5_ENABLE_PARALLEL=ON"