Changed the order of linking to resolve some debug build bugs and added the missing parent directory of the MYSQL_DIR into the included directories.