Add support for MinGW environments using bgd.dll.