This sounds like a well-known deficiency in the ROOT building procedure.
You seem to have another ROOT version installed somewhere (and “initialized” in your setup).
Before building a new ROOT version, always make sure that nothing in your environment variables (i.e., whatever the “${ROOTSYS}/bin/thisroot.sh” script sets, e.g., “${ROOTSYS}”, “${PATH}”, “${LD_LIBRARY_PATH}”, “${PYTHONPATH}”, “${CMAKE_PREFIX_PATH}”, and so on) points to another existing version of ROOT. Otherwise, you may end up with a broken build.
If you want to reconfigure/rebuild your ROOT, always start from a clean “build directory” (i.e., remove it and create a new one), so that no remnants of any “old build” are present.