The difference between lie and lay is a confusing one, especially if you have not studied it specifically.
Both words mean to put something down, whether it is a person or a thing.
The difference comes from whether or not the verb has an object behind it – just make sure you do not confuse the object of the verb with a prepositional phrase that has a prepositional object!
In other words, if you are not lying down, you need to say lay something down. If there is a sofa, you can lie down on it; when you are doing that, you are lying down on the sofa. If you have something that you want to put on the ground or the table, for example, you need to lay the thing down. For example, you would lay your phone on the table.
In this particular case, the correct verb should be lies. This is because there is no object of the verb. You are lying on the ground.
In this phrase, flat is the adjective describing how you are, and on the ground is the prepositional phrase that talks about where you are. The noun object, ground, is no the object of the verb.
For this reason, lie is the correct choice.