ups.. not quite correct. Off course the target template for a plugin is still lib!!! But you need to add a config entry:

CONFIG += plugin

to you plugin project...