Only check for tcmalloc symbols when linking statically (#455)
Merge review 465 by @srh (Closes #455)