Which one of those or they are equal?
./configure CFLAGS='-ggdb -O0'
OR
CFLAGS="-g -W -Wall" ./autogen.sh
Just use it the way I said.
The main reason for using "./autogen, make clean, make" is that it will also work every time you update your folder from git or copy new files into the same old directory
If you just use ./configure and not use make clean you will sometimes get problems.