fix jemalloc on cross-compiled builds

Closes #6998