  We study the interplay between superconductivity and non-Fermi liquid
behavior of a Fermi surface coupled to a massless $SU(N)$ matrix boson near the
quantum critical point. The presence of thermal infrared singularities in both
the fermionic self-energy and the gap equation invalidates the Eliashberg
approximation, and makes the quantum-critical pairing problem qualitatively
different from that at zero temperature. Taking the large $N$ limit, we solve
the gap equation beyond the Eliashberg approximation, and obtain the
superconducting temperature $T_c$ as a function of $N$. Our results show an
anomalous scaling between the zero-temperature gap and $T_c$. For $N$ greater
than a critical value, we find that $T_c$ vanishes with a
Berezinskii-Kosterlitz-Thouless scaling behavior, and the system retains
non-Fermi liquid behavior down to zero temperature. This confirms and extends
previous renormalization-group analyses done at $T=0$, and provides a
controlled example of a naked quantum critical point. We discuss the crucial
role of thermal fluctuations in relating our results with earlier work where
superconductivity always develops due to the special role of the first
Matsubara frequency.
