Fixed using `RbConfig::CONFIG['DLEXT']` instead of a hardcoded extension name, and tested on linux.