We have the following sum
S=∑0<a′≤k′(a′,k′)=1a′≡bmodqe(hl′a′/k′). Here, e(x):=exp(2πix), h,k′,q,a′ are all natural numbers. We do know that gcd(h,l′)=gcd(k′,l)=1 because of the reason that in the original sum in the paper, we had k and l which can be replaced by k′=k/(k,l) and l′=l/(l,k). We also know that (b,q)=1.
Hooley uses this notation: k′=∏pα∣∣k′pα which is just the prime decomposition and k′′=∏pα∣∣k′′;p∤qpα which seems a bit odd (?). After that, he goes on to write S=∑d∣k′′μ(d)∑0<a′≤k′′a′≡0modda′≡bmod(k′,q)e(hl′a′/k′). This is probably an attempt to write out the sum multiplied by ∑d∣(a′,k′)μ(d) to capture the condition (a′,k′)=1, but I don't see the connection with k′′. The author then claims that (k′/(k,q),q)=1 is a necessary and sufficient condition for S=0 and that this sum is μ{k′/(k′,q)}e(hl′a′/k′) where a′ is the unique root modulo k′ of the equations a≡0modk′/(k′,q) and a≡bmod(k,q).