So what should I do to solve it?
Read the documentation on Qt Configure Options, especially the section on Source, Build, and Install Directories. You do an out-of-source build using the -prefix option to specify where the output goes.