When I compile a software project from scratch - I normally start with installing the build dependencies for the version there is included in Ubuntu by doing:
sudo apt-get build-dep qemu
That ensures you have all libraries and the headers files your package is depended on. If your own fresh downloaded source don't use any new libraries you should have the needed libraries to build it.