Each time you change the ROOT version that you use, you must rebuild all your libraries and executables which depend on it.
I’m afraid this is a known deficiency. Eons ago, when I complained about it to Rene Brun (the founder of this project), I got the reply that it’s because “ROOT is not a set of libraries but a framework”.