[3172] Fix build failure on BSD systems

The comment at the end of adding to AM_CXXFLAGS was making the total
line too long, and the automake tool was splitting the line. This meant
that the macro assignment had an escaped comment, which the BSD make
interprets differently to GNU make (the latter swallows the next line as
part of the comment, whereas the former doesn't).