Use the Sky Scanner unit below to find cheap flights.
There are some good bus services that run from Lagos. Here are the timetables and websites.
The Local train service is small, cheap and reliable. Here are some links to the services.
Here are some tools to help you with your travel plans to and from Lagos. The Algarve and the rest of Portugal are fantastic. If you have time in your travels explore the country before you move on.