Automake does have a critical bug in that for a target which only optionally has C++ sources, that target is always linked using C++.
So it should only use C++ if the "option" is selected? Can you provide a test tree? Without this issue, the trick of including an empty optional C++ source file in the build would work. I don't yet understand how all this is playing together ... -k