diff --git a/src/bitmsghash/Makefile b/src/bitmsghash/Makefile
index 56a6a3a9..c4fb4ab5 100644
--- a/src/bitmsghash/Makefile
+++ b/src/bitmsghash/Makefile
@@ -15,10 +15,10 @@ powtest:
 	./testpow.py
 
 bitmsghash.so: bitmsghash.o
-	g++ bitmsghash.o -shared -fPIC -lcrypto $(LDFLAGS)
+	${CXX} bitmsghash.o -shared -fPIC -lcrypto $(LDFLAGS)
 
 bitmsghash.o:
-	g++ -Wall -O3 -march=native -fPIC $(CCFLAGS) -c bitmsghash.cpp
+	${CXX} -Wall -O3 -march=native -fPIC $(CCFLAGS) -c bitmsghash.cpp
 
 clean:
 	rm -f bitmsghash.o bitmsghash.so bitmsghash*.dll