Fix engine loading portability

Use GModule APIs for determining engine filenames.  Also, link with
the -no-undefined flag, required on PE platforms.

This is required for proper operation on Cygwin.