FOC for King–Plosser–Rebelo preferences
So Lets use a present value Hamiltonian here:

$H=e^{-pt}u(c)+\lambda(\dot k)$

FOC:
wrt c: $0=e^{-pt}u'(c)-\lambda$

wrt k: $-\dot\lambda=\lambda[(1-\tau)r -g]$

Take the FOC from consumption and differentiate wrt to time:

$\dot\lambda =-\gamma c^{-\gamma-1}\dot c e^{-pt+gt(1-\gamma)}e^{(1-\gamma)v(n)}+c^{-\gamma}e^{-pt+ gt(1-\gamma)}e^{(1-\gamma)v(n)}[(1-\gamma)(g+v'(n)\dot n)-p]$

Then substitute back in the FOC for consumption:

$\dot\lambda =-\gamma c^{-1}\dot c\lambda +\lambda[(1-\gamma)(g+v'(n)\dot n)-p]$

Then substitute this guy into the Foc for capital:

$g-(1-\tau )r=-\dot c/c\gamma+(1-\gamma)[g+v'(n)\dot n]-p$

leading to: 

$r(1-\tau)=p+(\dot c/c +g)\gamma+(1-\gamma)[-v'(n)\dot n] $