--- a/gen_data.c
+++ b/gen_data.c
@@ -24,9 +24,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
-#include "postgres.h"
+#include <stdbool.h>
+#include <string.h>
 
 
+typedef long long int64;
 
 static int64 rand_state = 1;
 static const int64 c = 12345;
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ prepare: prepare.o q3cube.o q3c_poly.o
 	$(CC) prepare.o q3cube.o q3c_poly.o $(PG_LDFLAGS) $(LDFLAGS) $(MYBINLIBS) -o $@
 
 gen_data: gen_data.c
-	$(CC) $< $(CPPFLAGS) $(PG_LFGLAGS) $(LDFLAGS) $(MYBINLIBS) -o $@
+	$(CC) $< $(CPPFLAGS) $(PG_LFGLAGS) $(LDFLAGS) -lm -o $@
 
 test: gen_data
 	createdb q3c_test
