Stan 2.16.2 install error

Ok so I tried doing this and I get the following error:

cc1plus: error: unrecognized command line option "-std=c++11"

My ~/.R/Makevars file looks like this:

CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function
CXXFLAGS += -std=c++11