Cleaned up the main configure script and added optional arg