Well it's not the library paths you want for that error, it's the header
files, but yes you would add the search path to the header files through
the -I option.
At the link step you will require the library paths, which you can specify
with the -L option (and specific library files with the lowercase
Presumably these are all working installations. So, you should be able to
run all the versions on the machine. If so, you should be able to build
against any of them and find your plugin runs with that installation.
While I'm not familiar with Maya plugin development, most systems for C/C++
will provide a define from the header files which indicates the version,
possibly called something akin to MAYA_VERSION. With this you should be
able to get your plugin running with all of the versions installed.