By coincidence I recently needed to consider essentially this same question.
By homogeneity one can fix the value of $\sum_{k=1}^{n} a_k^2$. Let us take this to be $n$. If all of the a_i's were equal to 1, then the max m will be asymptotically $\sqrt{n \ln(n)}$ (with an error term of $O\left( \sqrt{\frac{n}{\ln(n)}} \ln \ln(n) \right)$) with probability $1$. In the case of random +/- signs, the upper-bound is an old result of Salem and Zygmund (Some properties of trigonometric series whose terms have random signs) and the lower bound is a result of Halasz (On a result of Salem and Zygmund concerning random polynomials). The proof should easily modify to include the case of random Gaussians or more general i.i.d. random variables.
Its more difficult to state a result for general coefficients, since if the coefficients are concentrated on just a few terms (say just one term) the above result is obviously false. However, as long as not too much of the $\ell^2$ weight is concentrated on a single coefficient then the above result should still hold. Results in this direction are contained in the Salem and Zygmund paper.