Generate the shebang line

This uses `$SHELL` as a POSIX shell, coupled with a `configure` check
that sets it correctly.

Note that the POSIX shell might end up being bash, so this actually
introduces more fragmentation than it reduces.