In your Makefile you need to put the path to -ltbbmalloc in the LIB variable, something like this below. It should be included in your intel compiler install. You may also need to add "-tbb" to CCFLAGS.
Stan
CC = CC
OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload \
-fno-alias -ansi-alias -restrict -tbb $(OPTFLAGS)
SHFLAGS = -fPIC
DEPFLAGS = -M
LINK = CC
LINKFLAGS = -g -qopenmp $(OPTFLAGS)
LIB = -L/home/projects/x86-64-knl/intel/compilers/2017/compilers_and_libraries_2017.0.042/linux/tbb/lib/intel64/gcc4.4 -ltbbmalloc
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared