"Fame" (like "Lady Luck") is sometimes personified as a woman.
To "flirt" with someone is to behave as if you wanted a romantic relationship with them, but only in a half-serious way. Nobody is certain whether you mean it or not.
To "flirt with fame" is to seek fame, but not in a very serious way, so there's not much chance of success.
From a Google search, I learn that this is a quotation from the writer John LeCarre, about the art of writing. "Flirting with fame" might mean accepting invitations to read his work aloud, appear on talk shows, and going on book tours to promote his work. LeCarre suggests that a writer who does that is wasting precious time. He should be spending that time alone, sitting at his keyboard, waiting for ideas, or laboriously writing and rewriting and rewriting.