Better configure script
Fix Makefile
Precompile the query at compilation time