diff --git a/examples/twoway/Makefile b/examples/twoway/Makefile
index d4e5c7e1a29d0b4fc3028b4af1f768ac5fe242bb..cad00edf8d3fe6c734e0ef32de3ffe003abdc37e 100644
--- a/examples/twoway/Makefile
+++ b/examples/twoway/Makefile
@@ -1,9 +1,14 @@
+UNAME_S=$(shell uname -s)
+
 TARGETS=client server
 LABCOMM_JAR=../../compiler/labcomm_compiler.jar
 LABCOMM=java -jar $(LABCOMM_JAR) 
 
-include ../../lib/c/os_compat.mk
-CFLAGS+=-I../../lib/c/2014 -I.
+CFLAGS=-O3 -g -Wall -Werror -I../../lib/c/2014 -I. -Wno-unused-function
+
+ifeq ($(UNAME_S),Darwin)
+    CFLAGS+=-DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" -DLABCOMM_OS_DARWIN=1  -Wno-tautological-compare
+endif
 
 all: $(TARGETS:%=gen/%)