My recommendation would probably be to set up a chroot with a completely seperate package environment. You can then trash that one to install whatever you need (e.g. Mesa's EGL) and build happily in an environment kind of similar to the one the SDK uses.