I also just stumbled over that problem when compiling MonetDB on my Linux machine. Here is the solution/workaround that worked for me: Always make clean
after ./configure
.
In your example you should be able to do:
./configure --prefix=/root/build && make clean && make && make install
I found the solution in a discussion on an apache httpd bug where Joe Orton shares his knowledge:
A “make clean” is usually necessary after re-running “configure”.