diff --git a/slash/Makefile b/slash/Makefile
index f8cd233..eb81bcf 100644
--- a/slash/Makefile
+++ b/slash/Makefile
@@ -1,7 +1,14 @@
 CLEAN_FILES = # deliberately empty, so we can append below.
-CXX=g++
+CXX?= g++
 LDFLAGS= -lpthread -lrt
-CXXFLAGS= -g -std=c++11 -fno-builtin-memcmp -msse -msse4.2 -pipe -fPIC
+CXXFLAGS= -g -std=c++11 -fno-builtin-memcmp -pipe -fPIC
+ARCH:=$(shell uname -p)
+ifeq ($(ARCH), aarch64)
+	CXXFLAGS+=-march=armv8-a+crc+crypto -moutline-atomics
+endif
+ifeq ($(ARCH), x86_64)
+	CXXFLAGS+=-msse -msse4.2
+endif
 PROFILING_FLAGS= -pg
 ARFLAGS = rs
 OPT=