Update the Makefiles to use variables such as EGL_LIB_NAME. Define M_PI if it hasn't been defined yet.