Andersen thermostat in MD with rigid bond constraints
Hünenberger’s Thermostat algorithms for molecular dynamics simulations (PDF available here) is a generally concise and accurate reference on the topic. On stochastical thermostats such as Langevin, it does not use the number of degrees of freedom (i.e. reduced by the number of constraints) but actually uses the number of atoms.

One would have to follow the proper derivation of the thermostat's target ensemble (from the original Andersen paper) to make sure that is correct, but it seems likely to fix your problem of having too low kinetic energy.