I mentioned earlier here, I always configure G-P only by poiting it to geany's pkg-config file, that selects prefix and libdir correctly in my experience.
`./configure PKG_CONFIG_PATH=/home/lex/geany-meson/lib/x86_64-linux-gnu/pkgconfig` or whatever that is on Ubuntu.