bin = fbgfx
CFLAGS = -pedantic -Wall -g -O3
-LDFLAGS = -limago -lm -lpthread
+LDFLAGS = -limago -lm $(ldflags_pthread)
+
+ifeq ($(NOTHREADS), 1)
+ CFLAGS += -DNO_THREADS
+else
+ ldflags_pthread = -lpthread
+endif
$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)