build: use extended regex instead of PCRE in grep call in autogen.sh