Hmm. Looking at my command line showed me that I had a trailing space when I defined AM_PART_APOLLO3 in Segger Studio, which is why the system quoted it all with a space at the end. Fortunately, that ends up being completely harmless. But I fixed it anyway, and now I get:
-D_DEBUG -DAM_PACKAGE_BGA -DAM_PART_APOLLO3 -MD
If my crappy memory is right, the specific error you are seeing is due to the define of DEBUG via -DDEBUG. This defines a preprocessor symbol DEBUG to have no textual replacement. Sadly, there is a struct field inside the Ambiq HAL called DEBUG (boo: all upper case, so it looks just like a preprocessor symbol). Your -DDEBUG causes the name of that field (DEBUG) to vanish and the compiler gets annoyed when it is expecting to see a name and finds what follows the name instead.