For anyone that reaches this topic at some point, and are facing the exact same problem, here is what seems to be the fix. At least, it seems to fixed the problem for me. As Alex described, the problem seems to be in how I built the Libraw library in my machine. I just made a brand new clone of the Libraw repo, and I built the library from source again, following the steps described in the INSTALL file: https://github.com/LibRaw/LibRaw/blob/master/INSTALL
Then, I payed close attention in the compiler flags that were used in the Makefile that was generated by automake. Then, I changed the build command in my Makefile to use the same compiler flags that were used in the Makefile that was generated by the automake. As a result, I got this Makefile:
For anyone that reaches this topic at some point, and are facing the exact same problem, here is what seems to be the fix. At least, it seems to fixed the problem for me. As Alex described, the problem seems to be in how I built the Libraw library in my machine. I just made a brand new clone of the Libraw repo, and I built the library from source again, following the steps described in the INSTALL file: https://github.com/LibRaw/LibRaw/blob/master/INSTALL
Then, I payed close attention in the compiler flags that were used in the Makefile that was generated by automake. Then, I changed the build command in my Makefile to use the same compiler flags that were used in the Makefile that was generated by the automake. As a result, I got this Makefile:
There are still some issues in the results, but it is already much better with this change.