As mentioned in here, the error is Mac-specific but the solution what I found is a little different.
Use
hdf5_cv_mpi_complex_derived_datatype_works='no',
instead of
hdf5_mpi_complex_derived_datatype_works='no'
I have tested with HDF5 version 1.8.5.