--- rltiles/Makefile.orig	2016-04-30 03:53:03 UTC
+++ rltiles/Makefile
@@ -11,7 +11,6 @@ endif
 # is not supported.  If host=target, contribs are enough.
 
 PKGCONFIG = pkg-config
-CFLAGS := -O2 $(STDFLAG) -g -Wall -Wextra -Wno-parentheses -Wno-unused-parameter
 
 ifdef ANDROID
   CXXFLAGS :=
@@ -50,14 +49,14 @@ endif
 
 # Attempt to use a full compiler name, to make
 # distcc builds work nicely.
-LMACH := $(shell gcc -dumpmachine)-
+LMACH := $(shell $(CC) -dumpmachine)-
 ifeq ($(LMACH),-)
 LMACH :=
 endif
-ifeq ($(shell which $(LMACH)gcc > /dev/null 2> /dev/null && echo "Yes"),)
+ifeq ($(shell which $(LMACH)$(CC) > /dev/null 2> /dev/null && echo "Yes"),)
 LMACH :=
 endif
-HOSTCXX ?= $(LMACH)g++
+HOSTCXX ?= $(LMACH)$(CXX)
 
 DELETE = rm -f
 
