Stricter check for flex in configure.
I propose to change
if test "x$LEX" == "x"; then
into
if test "x$LEX" != "xflex"; then
in the unlikely but possible case where lex but but not flex is available as recommended in AC_PROG_LEX documentation.