improved debugging infrastructure

./configure can be now run with --enable-debug (default: false)

if debug is off -- compile with -g -O2
if debug is on -- compile with -g -O0 and DEBUG symbol is accessble from precompiler