--- a/Makefile	2017-03-29 12:04:15.000000000 +0300
+++ b/Makefile	2017-06-08 01:41:32.605031258 +0300
@@ -87,8 +87,6 @@
       CFLAGS += -minline-all-stringops
     endif
   endif
-else
-  CFLAGS += -O
 endif
 
 ifdef DEBUG
@@ -110,6 +108,7 @@
   endif
 else
   CFLAGS += -DNDEBUG
+  CXXFLAGS += -DNDEBUG
 endif
 
 ifdef MSG_LEVEL
@@ -127,6 +126,7 @@
 ifneq ($(MULTI_THREAD),)
   ifeq ($(shell expr $(MULTI_THREAD) \>= 1), 1)
     CFLAGS += -DMULTI_THREAD
+    CXXFLAGS += -DMULTI_THREAD
     ifneq ($(OSTYPE),haiku)
       LDFLAGS += -lpthread
     endif
@@ -142,11 +142,13 @@
     endif
     ifneq ($(REV),)
       CFLAGS  += -DREVISION="$(REV)"
+      CXXFLAGS  += -DREVISION="$(REV)"
     endif
   endif
 endif
 
 CFLAGS   += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS)
+CXXFLAGS   += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS)
 CCFLAGS  += -ansi -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 
 
@@ -514,6 +516,7 @@
     endif
   endif
   CFLAGS += $(SDL_CFLAGS)
+  CXXFLAGS += $(SDL_CFLAGS)
   LIBS   += $(SDL_LDFLAGS)
 endif
 
@@ -553,6 +556,7 @@
     endif
   endif
   CFLAGS += $(SDL_CFLAGS)
+  CXXFLAGS += $(SDL_CFLAGS)
   LIBS   += $(SDL_LDFLAGS)
 endif
 
@@ -568,6 +572,7 @@
     SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs)
   endif
   CFLAGS += $(SDL_CFLAGS)
+  CXXFLAGS += $(SDL_CFLAGS)
   LIBS   += $(SDL_LDFLAGS) -lSDL_mixer
 endif
 
@@ -594,6 +599,7 @@
     SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs)
   endif
   CFLAGS += $(SDL_CFLAGS)
+  CXXFLAGS += $(SDL_CFLAGS)
   LIBS   += $(SDL_LDFLAGS) -lglew32
   ifeq ($(OSTYPE),mingw)
     LIBS += -lopengl32
@@ -609,6 +615,7 @@
 endif
 
 CFLAGS += -DCOLOUR_DEPTH=$(COLOUR_DEPTH)
+CXXFLAGS += -DCOLOUR_DEPTH=$(COLOUR_DEPTH)
 
 ifneq ($(findstring $(OSTYPE), cygwin mingw),)
   SOURCES += simres.rc
@@ -616,7 +623,6 @@
 endif
 
 CCFLAGS  += $(CFLAGS)
-CXXFLAGS += $(CFLAGS)
 
 BUILDDIR ?= build/$(CFG)
 PROGDIR  ?= $(BUILDDIR)
