The lute was developed long before the modern flute was. However, for quite some time, recorders were also referred to as "flutes," as were panflutes. These originated before the lute did.
Answer:
The earliest flute (The Divje Babe flute) is a 43,000 year old cave bear femur pierced by spaced holes that was found at the Divje Babe archeological park located near Cerkno in northwestern Slovenia. The artifact was the product of Neanderthals.
The European lute ancestors (both in name and form) comes from the Arab instrument known as al 'Ud (the wood). It was introduced into Europe by the Moors during their conquest and occupation of Spain (711-1492).
The flute is therefore the predecessor of the lute by at least 43,000 years.