diff --git a/Makefile b/Makefile
index 54a6f648c8..4a933d1d01 100644
--- a/Makefile
+++ b/Makefile
@@ -132,8 +132,8 @@ ifneq (,$(findstring unix,$(platform)))
       LIBS += -lGL
    endif
    LDFLAGS +=  $(fpic) $(SHARED)
-   REALCC ?= gcc
-   NATIVECC ?= g++
+   REALCC ?= $(CC)
+   NATIVECC ?= $(CXX)
    NATIVECFLAGS ?= -std=gnu99
    BASELIBS += -lpthread
    CXX ?= g++
@@ -142,13 +142,13 @@ ifneq (,$(findstring unix,$(platform)))
    AR ?= @ar
    LD := $(CXX)
    LIBS += -lstdc++ -lpthread -ldl
-   ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
+   ifeq ($(firstword $(filter x86_64,$(ARCH))),x86_64)
       PTR64 = 1
    endif
-   ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
+   ifeq ($(firstword $(filter amd64,$(ARCH))),amd64)
       PTR64 = 1
    endif
-   ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64)
+   ifeq ($(firstword $(filter ppc64,$(ARCH))),ppc64)
       PTR64 = 1
    endif
    ifneq (,$(findstring ppc,$(UNAME)))
@@ -487,7 +487,7 @@ endif
 # utilities
 MD = -mkdir$(EXE_EXT)
 RM = @rm -f
-OBJDUMP = @objdump
+OBJDUMP ?= @objdump
 PYTHON ?= @python2
 
 #-------------------------------------------------
-- 
2.17.1

