pandoc > collect2: error: ld returned 1 exit status
pandoc > `gcc' failed in phase `Linker'. (Exit code: 1)
Building with Stack still has to use some system libraries, and I
assume a difference between Debian 8 and Debian 9 is tripping this
up. Can you get more info about what the linker error is? You should
be able to see more in the log files.