Check for flex when compiling from repository sources
Added missing version.h to Makefile.am