Don't use $abs_builddir/../src and the like. Use $abs_top_builddir/src instead. Then it's not assuming where it sits in the tree either, just where the named thing sits. You're still using ../.. in the library path, which is also bad.