Building Blender as a Python Module - Linux

I’ve been trying to compile Blender as a python module (following these instructions: https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake) to no avail. I’m able to make a classic out-of-source build, but once I do the changes in the “Building” section of those instructions, the build fails, and I’m unable to find a solution. I’m running a 64-bit machine with Linux (Ubuntu 16.04.3). and this is the relevant info that is outputted:

[ 98%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[ 98%] Linking CXX shared module …/…/bin/bpy.so
/usr/bin/ld.gold: error: /opt/lib/python-3.6/lib/libpython3.6m.a(abstract.o): requires dynamic R_X86_64_PC32 reloc against ‘PyType_IsSubtype’ which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /opt/lib/python-3.6/lib/libpython3.6m.a(boolobject.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /opt/lib/python-3.6/lib/libpython3.6m.a(bytearrayobject.o): requires dynamic R_X86_64_32 reloc against ‘_PyByteArray_empty_string’ which may overflow at runtime; recompile with -fPIC
.
.
(same error for other .o files)
.
.
/usr/bin/ld.gold: error: /opt/lib/python-3.6/lib/libpython3.6m.a(getcompiler.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
source/creator/CMakeFiles/blender.dir/build.make:363: recipe for target ‘bin/bpy.so’ failed
make[2]: *** [bin/bpy.so] Error 1
CMakeFiles/Makefile2:7766: recipe for target ‘source/creator/CMakeFiles/blender.dir/all’ failed
make[1]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
Makefile:160: recipe for target ‘all’ failed
make: *** [all] Error 2

I tried adding -fPIC to the /blender/CMakeLists.txt file as discussed here https://stackoverflow.com/questions/36779834/compiling-blender-bpy-recompile-with-fpic
I tried adding the CMAKE_POSITION_INDEPENDENT_CODE to ON in /blender/CMakeLists.txt as discussed here https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option
I tried changing everything to static linking as discussed in the “Manual CMake Setup / Static Linking” section here https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Ubuntu/CMake

Given how I failed at all my attempts so far and I’ve been able to waste 3 days on this, I’d be happy for any help I can get or to pay for someone to do it. My inexperience with C/C++ and having to deal with CMake for the first have me defeated. At this point I’d be happy to give someone with more experience than myself with this tech stack $50, that would probably get it done in less than 20 minutes, if they don’t have it already.

Any help is appreciated!