On the connection between the γ-ray and (sub-)mm emission in active galactic nuclei