As Chris Wuthrich said, one needs to look at the elliptic curve $E$ defined over $\mathbb{Q}$ by $y^2=x^3+6x^2+x$. Over $\mathbb{C}$, the curve is isomorphic to $\mathbb{C}/(\mathbb{Z}+2i\mathbb{Z})$. Indeed, the $j$-invariant of $E$ is $66^3=j(2i)$, and the conductor is $32$. I know this from Sage and Google. So $L(s,E)$ equals $L(s,\chi)$, where $\chi$ is a Hecke character over $\mathbb{Q}(i)$ which ramifies only at the prime ideal $(1+i)$. One can pin down $\chi$ precisely by looking up the precise functional equation of $L(s,\chi)$. Here I normalize $L$-functions so that $s$ is related to $1-s$ in the functional equation.
I am lazy to calculate everything precisely, but the point is that $S$ essentially the difference between $\#E(\mathbb{F}_p)$ and $p+1$, which is what the Hasse bound is about. So $S/\sqrt{p}$ is essentially the $p$-th Dirichlet coefficient of $L(s,E)=L(s,\chi)$: it is zero for $p\equiv 3\pmod{4}$, and it is $\chi(\pi)+\chi(\overline{\pi})$ when $p\equiv 1\pmod{4}$, and the ideal $(p)$ factors as $\pi\overline{\pi}$ in $\mathbb{Z}[i]$.