fix dynamic prefix detection on linux - closes #1701