Index: Makefile
--- Makefile.orig	2015-09-30 09:39:45.000000000 +0200
+++ Makefile	2016-11-01 09:22:55.836134502 +0100
@@ -43,7 +43,7 @@
 
 ISO_CHAR_SET	= 1
 
-OPTIMIZEFLAGS	= -O3
+OPTIMIZEFLAGS	= -O2
 DEFINEFLAGS	= -DHAVE_DIRENT_H=$(HAVE_DIRENT_H)     \
 		  -DHAVE_SYS_DIR_H=$(HAVE_SYS_DIR_H)   \
 		  -DHAVE_SYS_NDIR_H=$(HAVE_SYS_NDIR_H) \
Index: checkfil.c
--- checkfil.c.orig	2016-11-01 09:22:55.836134000 +0100
+++ checkfil.c	2016-11-01 09:23:25.426123523 +0100
@@ -10,9 +10,7 @@
 #include <ctype.h>
 #include <fcntl.h>
 #include <sys/types.h>
-#ifdef __APPLE__
-    #include <sys/stat.h>
-#endif
+#include <sys/stat.h>
 #include <errno.h>
 #include "checkfil.h"
 
Index: newmgrep.c
--- newmgrep.c.orig	2016-11-01 09:22:55.836134000 +0100
+++ newmgrep.c	2016-11-01 09:23:42.656113158 +0100
@@ -16,9 +16,7 @@
 #include <sys/types.h>
 #endif
 
-#if defined(_WIN32) || defined(__APPLE__)
-    #include <sys/stat.h>
-#endif
+#include <sys/stat.h>
 
 #include "agrep.h"
 #include "codepage.h"
Index: recursiv.c
--- recursiv.c.orig	2016-11-01 09:20:45.000000000 +0100
+++ recursiv.c	2016-11-01 09:22:55.836134502 +0100
@@ -21,7 +21,10 @@
 
 #include "autoconf.h"	/* ../libtemplate/include */
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 
 #if	ISO_CHAR_SET
 #include <locale.h>
