A joint sponsor on the I-864 affidavit of support need not be related to you. You should review the instructions to the form carefully to determine what the co-sponsor is agreeing to.
It is unclear from your question whether your girlfriend entered the US legally of illegally. If she did not enter legally, she can not become a PR simply by marrying a US citizen without requesting certain waivers. In this regard, we suggest you contact a reputable immigration attorney.
If she entered legally, but is out of status, then a co-sponsor, who can prove that they earn more than $18,000 per year or have assets which exceed this amount, can sign as a co-sponsor. This joint sponsor does not need to be related to either of you, but will represent to the government that they will support your girlfriend financially.