Fixed issue with library order and gcc