The NATO intervention has nothing to do with this. The previous dictator created the threat to dissuade the EU from removing him. Now that he's out of the picture, the inevitable happened.
A good lesson is to stop propping dictators in exchange for short-term stability. Based on the current events, the EU did not learn that lesson.
No, the lesson is to stop interfering in other countries' internal affairs. The so-called refugees all originate from countries that suffered western military operations. "Humanitarian" intervention is the new colonialism.
Pakistan did not suffer "Western military operations", at least not recently and at a big scale, and half of the refugees in the ship were probably Pakistani.
"Humanitarian" intervention has always been an excuse to conquer, at least from the times of the Persian Empire or so.
And there have been refugee waves wherever there had been war and famine - that is all over the globe, with nothing explicitly indicating the "western interventions" are outsiders
The vast majority of refugees crossing the Mediterranean are from countries torn apart by western-instigated civil unrest or war: Syria, Iraq, Afghanistan, Lybia, and various north African countries subject to "color revolutions". This isn't even remotely controversial. Pakistanis, Indians, Nepalese, generally fly in with tourist or student visas, and then try to find work.
A good lesson is to stop propping dictators in exchange for short-term stability. Based on the current events, the EU did not learn that lesson.