May it be, that esbox (or the eclipse build environment) just generates these Makefiles. If you change them your manual build may succeed but from within esbox or when building the package they are re-generated and your changes vanish?
By the way, those compiler and linker flags are often set through pkg-config like "pkg-config --cflags --libs liblocation". Does esbox provide thome project settings where you can set dependency with pkg-config?
PKG_CHECK_MODULES(DEPS, gtk+-2.0 >= 2.2 glib-2.0 >= 2.2 gnome-vfs-2.0 >= 2.2 liblocation >= 0.1) AC_SUBST(DEPS_CFLAGS) AC_SUBST(DEPS_LIBS)