fix variable names and makefile logic to correctly set PKGDIRSETUP and SWIGOPT for different cases