Only regenerate the man page when required.

Make the flex binary an order-only prerequisite, and add back the
prerequisites from before 7cfb440. This prevents rebuilding the man page
whenever the flex binary is rebuilt, which causes problems if help2man
is not installed and will never work when cross compiling.

Fixes #108.
diff --git a/NEWS b/NEWS
index 5519b3b..423af03 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,10 @@
     included in the build/installation targets of flex since it was
     unused.
 
+*** the distributed man page is only rebuilt when the relevant source
+    files change or when the binary doesn't exist. In particular, this
+    is friendlier to cross compilation. Resolves #108
+
 * version 2.6.2 released 2016-10-24
 
 ** flex internals
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 882843c..7ad39c7 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,7 @@
 help2man = @HELP2MAN@
 
+FLEX = $(top_builddir)/src/flex$(EXEEXT)
+
 info_TEXINFOS =	flex.texi
 dist_man_MANS = flex.1
 DISTCLEANFILES = flex.1
@@ -23,8 +25,8 @@
 	flex.vr \
 	flex.vrs
 
-flex.1: ../src/flex$(EXEEXT)
+flex.1: $(top_srcdir)/configure.ac $(top_srcdir)/src/flex.skl $(top_srcdir)/src/options.c $(top_srcdir)/src/options.h | $(FLEX)
 	$(help2man) --name='$(PACKAGE_NAME)' --section=1 \
 	--source='The Flex Project' --manual='Programming' \
-	--output=$@ $< \
+	--output=$@ $(FLEX) \
 	|| rm -f $@