-fimplicit-termplates must be in CXXFLAGS not in handlersocket_la_CXXFLAGS. otehrwise automake puts it in the command line too early to override global -fno-implicit-templates