Let $q \in \mathbb{N}$. I am interested in getting an upper bound for the sum $$ \sum_{(a_1, a_2, a_3, q) = 1} \sum_{\mathbf{h} \in (\mathbb{Z}/q\mathbb{Z})^n }e( \frac{a_1}{q}\ell_1(h_1, \ldots, h_n) + \frac{a_2}{q}\ell_2(h_1, \ldots, h_n) + \frac{a_3}{q}\ell_3(h_1, \ldots, h_n) ) $$ where $\ell_i$ is a linear form with integral coefficients, and the only thing we know is that the matrix formed by them have rank $3$ over $\mathbb{Q}$. And $e(z) = e^{2\pi i z}$.
I am hoping to obtain $\ll q^{n-3 - \delta}$ (the implicit constant may depend on the coefficients of the linear forms) for some $\delta>0$ but I have not been able to find a way to do this so far...
I would appreciate any suggestions on how I can approach this problem. Thank you.