The Greek is unambiguously referring to the church, not God. The word church (ἐκκλησία) is nominative case; the word God is in the genitive case (modifying the word church). The two words pillar (στῦλος) and ground (ἑδραίωμα ) are also nominative case, showing that they are in apposition to the church, not God. The Greek cases match each other when in an appositional relationship (see Wallace, Greek Grammar Beyond the Basics, 48), which helps to sort out many things that might be ambiguous in English (where word order and punctuation tends to be a major clue).
As Susan noted in her comment, the KJV reading does not necessarily read God as the foundation (it could be read that way in English), but can be read that "the church of God" (the whole phrase with prepositional modifier) is the foundation—which still keeps church as the proper subject for the apposition, just clarified that not any church is such, but only "the church of God."
That church (or church of God) is the apposed item in this verse is not to deny that God is the foundation (i.e. in the sense of ultimate grounding) of truth itself, for He is true (Jn 3:33; Rom 3:4; et. al.), and Christ is the manifestation of that (Jn 14:6).
But the verse is saying that the church (specifically its witness of Christ, see 1 Tim 3:16)—for they know the truth (1 Tim 4:3)—is where the truth about God is supported (pillars and foundation picture support). This support is emphasized here because as 1 Timothy continues, it notes there is coming a time when faith will be departed from (1 Tim 4:1-3), but Timothy is to instruct properly (1 Tim 4:6-11), to support truth in the church (and in the world).